﻿/// <reference path="../release/ajaxstack-core.js"/>
/// <reference path="../release/jsApi-vsdoc.js"/>

function jQueryExt()
{
}
var JQ = jQueryExt;
JQ.addAfter = function(jq, attr, html)
{
	attr = attr || {};
	var id = attr['id'], className = attr['class'], next = jq.next();

	//skip if this element already exists
	if (next)
	{
		if (id && next.attr('id') == id) return;
		if (className && next.attr('class') == className) return;
	}

	jq.parent().append(H.span(attr, html));
}
JQ.removeAfter = function(jq, attr)
{
	attr = attr || {};
	var id = attr['id'], className = attr['class'], next = jq.next();

	if (!next) return;

	if (id && next.attr('id') == id) next.remove();
	else if (className && next.attr('class') == className) next.remove();
	else next.remove();
}
JQ.disable = function(jq)
{
	jq.attr('disabled', true);
	jq.blur();
}
JQ.enable = function(jq)
{
	jq.attr('disabled', false);
}
